package com.huiquan.vocab.dao;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.huiquan.framework.base.EnhancedBaseDao;
import com.huiquan.vocab.domain.VocabElementCategory;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class VocabElementCategoryDao extends EnhancedBaseDao<VocabElementCategory> {

	@Resource(name = "sqlMapClient")
	private SqlMapClient sqlMapClient;

	public static final String space = "VOCAB_ELEMENT_CATEGORY.";

	public VocabElementCategoryDao() {
		super(space);
	}

	public VocabElementCategory retrieveObjectByName(String name) {
		Map<String, Object> param = new HashMap<>();
		param.put("name", name);
		
		return (VocabElementCategory) this.object(space + "RETRIEVE_OBJECT", param, sqlMapClient);
	}
}
